<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Origami::Graphics::Path</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Origami::Graphics::Path</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/origami/graphics/path_rb.html">
                origami/graphics/path.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000062">add_segment</a>&nbsp;&nbsp;
      <a href="#M000061">close!</a>&nbsp;&nbsp;
      <a href="#M000060">is_closed?</a>&nbsp;&nbsp;
      <a href="#M000059">new</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="Path/Segment.html" class="link">Origami::Graphics::Path::Segment</a><br />
Class <a href="Path/Line.html" class="link">Origami::Graphics::Path::Line</a><br />

    </div>




    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">current_point</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">segments</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000059" class="method-detail">
        <a name="M000059"></a>

        <div class="method-heading">
          <a href="#M000059" class="method-signature">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000059-source">
<pre>
    <span class="ruby-comment cmt"># File origami/graphics/path.rb, line 77</span>
77:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
78:         <span class="ruby-ivar">@segments</span> = []
79:         <span class="ruby-ivar">@current_point</span> = <span class="ruby-keyword kw">nil</span>
80:         <span class="ruby-ivar">@closed</span> = <span class="ruby-keyword kw">false</span>
81:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000062" class="method-detail">
        <a name="M000062"></a>

        <div class="method-heading">
          <a href="#M000062" class="method-signature">
          <span class="method-name">add_segment</span><span class="method-args">(seg)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000062-source">
<pre>
     <span class="ruby-comment cmt"># File origami/graphics/path.rb, line 96</span>
 96:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_segment</span>(<span class="ruby-identifier">seg</span>)
 97:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">GraphicsStateError</span>, <span class="ruby-value str">&quot;Cannot modify closed subpath&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_closed?</span>
 98: 
 99:         <span class="ruby-ivar">@segments</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">seg</span>
100:         <span class="ruby-ivar">@current_point</span> = <span class="ruby-identifier">seg</span>.<span class="ruby-identifier">to</span>
101:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000061" class="method-detail">
        <a name="M000061"></a>

        <div class="method-heading">
          <a href="#M000061" class="method-signature">
          <span class="method-name">close!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000061-source">
<pre>
    <span class="ruby-comment cmt"># File origami/graphics/path.rb, line 87</span>
87:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close!</span>
88:         <span class="ruby-identifier">from</span> = <span class="ruby-ivar">@current_point</span>
89:         <span class="ruby-identifier">to</span> = <span class="ruby-ivar">@segments</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">from</span>
90:         
91:         <span class="ruby-ivar">@segments</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Line</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
92:         <span class="ruby-ivar">@segments</span>.<span class="ruby-identifier">freeze</span>
93:         <span class="ruby-ivar">@closed</span> = <span class="ruby-keyword kw">true</span>
94:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000060" class="method-detail">
        <a name="M000060"></a>

        <div class="method-heading">
          <a href="#M000060" class="method-signature">
          <span class="method-name">is_closed?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000060-source">
<pre>
    <span class="ruby-comment cmt"># File origami/graphics/path.rb, line 83</span>
83:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_closed?</span>
84:         <span class="ruby-ivar">@closed</span>
85:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>